time: 2021.3
# -*- coding: utf-8 -*-
# @Time    : 2021/4/18 19:59
# @Author  : luogan
# @Email   : 468640092@qq.com
# @File    : 统计字符串每个单词出现的次数.py
# @Software: PyCharm.

#统计字符串每个单词出现的次数

tcount = {}
lst = ["a", "a", "b", "b", "bdfas", "c", "c", "c", "c"]
for i in lst:
    if i in tcount:
        tcount[i] += 1
    else:
        tcount[i] = 1
print(tcount)